class Teacher < ActiveRecord::Base
  belongs_to :academic_degree
  belongs_to :person, :primary_key => 'id', :foreign_key => 'id'
  has_many :group_teachers
  has_many :groups, :through => :group_teachers

  validates_presence_of :academic_degree_id
  validates_associated :person

  accepts_nested_attributes_for :person, :allow_destroy => :true
end
